//
//  ArtDetailTableViewCell.m
//  chanyou
//
//  Created by 高爽 on 15-1-4.
//  Copyright (c) 2015年 wanli. All rights reserved.
//

#import "ArtDetailTableViewCell.h"

#import "Masonry.h"

#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

#import "Masonry.h"

@implementation ArtDetailTableViewCell

- (void)dealloc
{
    [_content release];
    [_subLabel release];
    [_groupPic release];
    [_loc release];
    [_user release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // 撤销点击效果
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.content = [[UILabel alloc] init];
        [_content setTextColor:[UIColor blackColor]];
        NSLog(@"width = %f", self.frame.size.width);
        
        _content.numberOfLines = 0;
        [_content setFont:[UIFont systemFontOfSize:15.0]];
        [self.contentView addSubview:_content];
        [_content release];
        
        self.tip = [[UIImageView alloc] init];
        _tip.image = [UIImage imageNamed:@"iconfont-tip.png"];
        [self.contentView addSubview:_tip];
        [_tip release];
        
        self.subLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 10, SCREEN_WIDTH - 40, 20)];
        [_subLabel setTextColor:[UIColor blackColor]];
        _subLabel.numberOfLines = 0;
        [self.contentView addSubview:_subLabel];
        [_subLabel release];
        
        
//        UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(2, 30, SCREEN_WIDTH - 4, 5)];
//        [line setText:@"-------------⊹-------------"];// ⊹☆
//        [line setTextColor:[UIColor whiteColor]];
//        [self.contentView addSubview:line];
//        [line release];
        
    }return self;
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [_tip mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(5);
        make.top.equalTo(self.contentView.mas_top).offset(5);
        
        make.size.mas_equalTo(CGSizeMake(20, 20));
    }];
    
    [_subLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(30);
        make.top.equalTo(self.contentView.mas_top).offset(10);
        
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH - 40, 20));
    }];
    
    [_content mas_makeConstraints:^(MASConstraintMaker *make) {

        make.top.left.bottom.right.equalTo(self.contentView).with.insets(UIEdgeInsetsMake(25, 10, 10, 10));

        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH - 10, SCREEN_HEIGHT / 2));
    }];
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
